package com.example.system.service.impl;

import com.example.system.domain.Config;
import com.example.system.domain.bo.PageBo;
import com.example.system.domain.vo.PageVo;
import com.example.system.mapper.ConfigMapper;
import com.example.system.service.ConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ConfigServiceImpl implements ConfigService {
    @Autowired
    private ConfigMapper configMapper;

    @Override
    public Config getByKey(String key) {
        return configMapper.getOneByKey(key);
    }

    @Override
    public PageVo<Config> getList(PageBo pageBo) {
        List<Config> list = configMapper.getList();
        return new PageVo<>(pageBo, list);
    }
}
